package com.health.commons;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

 

public class MD5 {
	public final static String getMd5(String str) {
		MessageDigest mdInst = null;
		try {
			mdInst = MessageDigest.getInstance("MD5");
		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
		}
		mdInst.update(str.getBytes());
		byte[] md = mdInst.digest();
		return StrConvertUtil.byteArrToHexStr(md);
	}
}
